﻿using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq;
using System.Reflection;
using System.Text;
using Cloak.Reflection;

namespace Ruleweaver.Rules.CheckMethods
{
	public sealed class SequenceContainsMethod : LinqCheckMethod
	{
		private readonly object _value;

		public SequenceContainsMethod(object value, LinqResolution resolution) : base(resolution)
		{
			_value = value;
		}

		protected override MethodInfo GetMethod(Type elementType, Type targetType, Type checkType)
		{
			throw new NotImplementedException();

			//return
			//  (from method in typeof(Checkable).GetMethods(BindingFlags.Public | BindingFlags.Static)
			//   where method.Name == "Contains"
			//   let parameters = method.GetParameters()
			//   where parameters.Length == 2
			//   where IsCheckParameter(parameters.First(), checkType)
			//   select method)
			//   .Single()
			//   .MakeGenericMethod(elementType);
		}

		protected override IEnumerable<object> GetCheckArguments(Type targetType)
		{
			yield return _value;
		}
	}
}